package com.zz.inventory.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zz.inventory.mapper.UserPackageRecordsMapper;
import com.zz.inventory.domain.UserPackageRecords;
import com.zz.inventory.service.IUserPackageRecordsService;

/**
 * 套餐权益记录Service业务层处理
 * 
 * @author zz
 * @date 2025-07-06
 */
@Service
public class UserPackageRecordsServiceImpl implements IUserPackageRecordsService 
{
    @Autowired
    private UserPackageRecordsMapper userPackageRecordsMapper;

    /**
     * 查询套餐权益记录
     * 
     * @param recordId 套餐权益记录主键
     * @return 套餐权益记录
     */
    @Override
    public UserPackageRecords selectUserPackageRecordsByRecordId(Long recordId)
    {
        return userPackageRecordsMapper.selectUserPackageRecordsByRecordId(recordId);
    }

    /**
     * 查询套餐权益记录列表
     * 
     * @param userPackageRecords 套餐权益记录
     * @return 套餐权益记录
     */
    @Override
    public List<UserPackageRecords> selectUserPackageRecordsList(UserPackageRecords userPackageRecords)
    {
        return userPackageRecordsMapper.selectUserPackageRecordsList(userPackageRecords);
    }

    /**
     * 新增套餐权益记录
     * 
     * @param userPackageRecords 套餐权益记录
     * @return 结果
     */
    @Override
    public int insertUserPackageRecords(UserPackageRecords userPackageRecords)
    {
        userPackageRecords.setCreateTime(DateUtils.getNowDate());
        return userPackageRecordsMapper.insertUserPackageRecords(userPackageRecords);
    }

    /**
     * 修改套餐权益记录
     * 
     * @param userPackageRecords 套餐权益记录
     * @return 结果
     */
    @Override
    public int updateUserPackageRecords(UserPackageRecords userPackageRecords)
    {
        return userPackageRecordsMapper.updateUserPackageRecords(userPackageRecords);
    }

    /**
     * 批量删除套餐权益记录
     * 
     * @param recordIds 需要删除的套餐权益记录主键
     * @return 结果
     */
    @Override
    public int deleteUserPackageRecordsByRecordIds(Long[] recordIds)
    {
        return userPackageRecordsMapper.deleteUserPackageRecordsByRecordIds(recordIds);
    }

    /**
     * 删除套餐权益记录信息
     * 
     * @param recordId 套餐权益记录主键
     * @return 结果
     */
    @Override
    public int deleteUserPackageRecordsByRecordId(Long recordId)
    {
        return userPackageRecordsMapper.deleteUserPackageRecordsByRecordId(recordId);
    }
}
